/**
 * 
 */
package br.edu.catolica.sadbc.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import net.java.dev.xseam.validation.CPF;

import org.hibernate.validator.Length;
import org.jboss.seam.annotations.Name;

import br.edu.catolica.sadbc.core.entity.AbstractEntity;

/**
 * @author robert.resende
 * 
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Name(value = "pessoa")
public class Pessoa extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id_pessoa")
	private Long id;

	@Length(min = 5, message = "Campo nome menor que 5 caracteres.")
	@Column(name = "nome", insertable = true, updatable = true, nullable = false)
	private String nome;

	@CPF
	@Column(name = "cpf", unique = true, nullable = false, insertable = true, updatable = false, length = 14)
	private String cpf;

	@Column(name = "rg", unique = false, nullable = false, insertable = true, updatable = true, length = 14)
	private String rg;

	@Temporal(TemporalType.DATE)
	@Column(name = "dataNascimento", unique = false, nullable = false, insertable = true, updatable = true)
	private Date dataNascimento;

	@Column(name = "email", unique = false, nullable = false, insertable = true, updatable = true, length = 50)
	private String email;
	
	@Column(name = "telefone", unique = false, nullable = false, insertable = true, updatable = true, length = 50)
	private String telefone;
	
	@Column(name = "sexo", unique = false, nullable = false, insertable = true, updatable = true)
	private Integer sexo;
	
	public Pessoa() {

	}

	@Override
	public Long getId() {
		return id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getCpf() {
		return cpf;
	}

	public void setCpf(String cpf) {
		this.cpf = cpf;
	}

	public String getRg() {
		return rg;
	}

	public void setRg(String rg) {
		this.rg = rg;
	}

	public Date getDataNascimento() {
		return dataNascimento;
	}

	public void setDataNascimento(Date dataNascimento) {
		this.dataNascimento = dataNascimento;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTelefone() {
		return telefone;
	}

	public void setTelefone(String telefone) {
		this.telefone = telefone;
	}

	public Integer getSexo() {
		return sexo;
	}

	public void setSexo(Integer sexo) {
		this.sexo = sexo;
	}

}
